//
//  GKZYUserLogoutTableViewCell.m
//  GKZYAid
//
//  Created by lanou3g on 16/3/14.
//  Copyright © 2016年 GKZYAid. All rights reserved.
//

#import "GKZYUserLogoutTableViewCell.h"

@implementation GKZYUserLogoutTableViewCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self addAllViews];
    }
    return self;
}

- (void)addAllViews
{
    self.backgroundColor = [UIColor orangeColor];
    
    self.imageHeadPortrait = [[UIImageView alloc] initWithFrame:CGRectMake(self.contentView.frame.size.width * 0.05, self.contentView.frame.size.height * 0.2, self.contentView.frame.size.height * 0.6, self.contentView.frame.size.height * 0.6)];
    self.imageHeadPortrait.layer.masksToBounds = YES;
    self.imageHeadPortrait.layer.borderWidth = 2;
    self.imageHeadPortrait.layer.borderColor = [UIColor whiteColor].CGColor;
    self.imageHeadPortrait.layer.cornerRadius = self.imageHeadPortrait.frame.size.height * 0.5;
    [self.contentView addSubview:self.imageHeadPortrait];
    
    self.buttonLogin = [UIButton buttonWithType:UIButtonTypeCustom];
    self.buttonLogin.frame = CGRectMake(CGRectGetMaxX(self.imageHeadPortrait.frame) + self.frame.size.width * 0.05, self.frame.size.height * 0.35, self.frame.size.width * 0.4, self.frame.size.height * 0.3);
    [self.buttonLogin setTitle:@"立即登录" forState:UIControlStateNormal];
    [self.buttonLogin setTitleColor:[UIColor orangeColor] forState:UIControlStateNormal];
    self.buttonLogin.backgroundColor = [UIColor whiteColor];
    self.buttonLogin.layer.masksToBounds = YES;
    self.buttonLogin.layer.cornerRadius = 20;
    [self.contentView addSubview:self.buttonLogin];
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    self.imageHeadPortrait.frame = CGRectMake(self.frame.size.width * 0.05, self.frame.size.height * 0.2, self.frame.size.height * 0.6, self.frame.size.height * 0.6);
    self.imageHeadPortrait.layer.cornerRadius = self.imageHeadPortrait.frame.size.height * 0.5;
    
    self.buttonLogin.frame = CGRectMake(CGRectGetMaxX(self.imageHeadPortrait.frame) + self.frame.size.width * 0.05, self.frame.size.height * 0.35, self.frame.size.width * 0.4, self.frame.size.height * 0.3);
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
